3.2.8 \(\int \frac {a+b x^2}{1-x^2} \, dx\)

Optimal. Leaf size=11 \[ (a+b) \tanh ^{-1}(x)-b x \]

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 11, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {388, 206} \begin {gather*} (a+b) \tanh ^{-1}(x)-b x \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + b*x^2)/(1 - x^2),x]

[Out]

-(b*x) + (a + b)*ArcTanh[x]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 388

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[(d*x*(a + b*x^n)^(p + 1))/(b*(n*
(p + 1) + 1)), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(b*(n*(p + 1) + 1)), Int[(a + b*x^n)^p, x], x] /; FreeQ[{
a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && NeQ[n*(p + 1) + 1, 0]

Rubi steps

\begin {align*} \int \frac {a+b x^2}{1-x^2} \, dx &=-b x-(-a-b) \int \frac {1}{1-x^2} \, dx\\ &=-b x+(a+b) \tanh ^{-1}(x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [B]  time = 0.01, size = 28, normalized size = 2.55 \begin {gather*} \frac {1}{2} (-(a+b) \log (1-x)+(a+b) \log (x+1)-2 b x) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + b*x^2)/(1 - x^2),x]

[Out]

(-2*b*x - (a + b)*Log[1 - x] + (a + b)*Log[1 + x])/2

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {a+b x^2}{1-x^2} \, dx \end {gather*}

Verification is not applicable to the result.

[In]

IntegrateAlgebraic[(a + b*x^2)/(1 - x^2),x]

[Out]

IntegrateAlgebraic[(a + b*x^2)/(1 - x^2), x]

________________________________________________________________________________________

fricas [B]  time = 0.47, size = 23, normalized size = 2.09 \begin {gather*} -b x + \frac {1}{2} \, {\left (a + b\right )} \log \left (x + 1\right ) - \frac {1}{2} \, {\left (a + b\right )} \log \left (x - 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x^2+a)/(-x^2+1),x, algorithm="fricas")

[Out]

-b*x + 1/2*(a + b)*log(x + 1) - 1/2*(a + b)*log(x - 1)

________________________________________________________________________________________

giac [B]  time = 0.36, size = 25, normalized size = 2.27 \begin {gather*} -b x + \frac {1}{2} \, {\left (a + b\right )} \log \left ({\left | x + 1 \right |}\right ) - \frac {1}{2} \, {\left (a + b\right )} \log \left ({\left | x - 1 \right |}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x^2+a)/(-x^2+1),x, algorithm="giac")

[Out]

-b*x + 1/2*(a + b)*log(abs(x + 1)) - 1/2*(a + b)*log(abs(x - 1))

________________________________________________________________________________________

maple [B]  time = 0.00, size = 34, normalized size = 3.09 \begin {gather*} -\frac {a \ln \left (x -1\right )}{2}+\frac {a \ln \left (x +1\right )}{2}-b x -\frac {b \ln \left (x -1\right )}{2}+\frac {b \ln \left (x +1\right )}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*x^2+a)/(-x^2+1),x)

[Out]

-b*x-1/2*ln(x-1)*a-1/2*ln(x-1)*b+1/2*ln(x+1)*a+1/2*ln(x+1)*b

________________________________________________________________________________________

maxima [B]  time = 0.99, size = 23, normalized size = 2.09 \begin {gather*} -b x + \frac {1}{2} \, {\left (a + b\right )} \log \left (x + 1\right ) - \frac {1}{2} \, {\left (a + b\right )} \log \left (x - 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x^2+a)/(-x^2+1),x, algorithm="maxima")

[Out]

-b*x + 1/2*(a + b)*log(x + 1) - 1/2*(a + b)*log(x - 1)

________________________________________________________________________________________

mupad [B]  time = 0.11, size = 11, normalized size = 1.00 \begin {gather*} \mathrm {atanh}\relax (x)\,\left (a+b\right )-b\,x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-(a + b*x^2)/(x^2 - 1),x)

[Out]

atanh(x)*(a + b) - b*x

________________________________________________________________________________________

sympy [B]  time = 0.17, size = 22, normalized size = 2.00 \begin {gather*} - b x - \frac {\left (a + b\right ) \log {\left (x - 1 \right )}}{2} + \frac {\left (a + b\right ) \log {\left (x + 1 \right )}}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x**2+a)/(-x**2+1),x)

[Out]

-b*x - (a + b)*log(x - 1)/2 + (a + b)*log(x + 1)/2

________________________________________________________________________________________